home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / arpa / RCS / tftp.h,v < prev   
Encoding:
Text File  |  1988-07-23  |  1.4 KB  |  73 lines

  1. head     1.1;
  2. access   ;
  3. symbols  ;
  4. locks    ; strict;
  5. comment  @ * @;
  6.  
  7.  
  8. 1.1
  9. date     88.07.22.18.12.52;  author ouster;  state Exp;
  10. branches ;
  11. next     ;
  12.  
  13.  
  14. desc
  15. @@
  16.  
  17.  
  18.  
  19. 1.1
  20. log
  21. @Initial revision
  22. @
  23. text
  24. @/*
  25.  * Copyright (c) 1983 Regents of the University of California.
  26.  * All rights reserved.  The Berkeley software License Agreement
  27.  * specifies the terms and conditions for redistribution.
  28.  *
  29.  *    @@(#)tftp.h    5.1 (Berkeley) 5/30/85
  30.  */
  31.  
  32. /*
  33.  * Trivial File Transfer Protocol (IEN-133)
  34.  */
  35. #define    SEGSIZE        512        /* data segment size */
  36.  
  37. /*
  38.  * Packet types.
  39.  */
  40. #define    RRQ    01            /* read request */
  41. #define    WRQ    02            /* write request */
  42. #define    DATA    03            /* data packet */
  43. #define    ACK    04            /* acknowledgement */
  44. #define    ERROR    05            /* error code */
  45.  
  46. struct    tftphdr {
  47.     short    th_opcode;        /* packet type */
  48.     union {
  49.         short    tu_block;    /* block # */
  50.         short    tu_code;    /* error code */
  51.         char    tu_stuff[1];    /* request packet stuff */
  52.     } th_u;
  53.     char    th_data[1];        /* data or error string */
  54. };
  55.  
  56. #define    th_block    th_u.tu_block
  57. #define    th_code        th_u.tu_code
  58. #define    th_stuff    th_u.tu_stuff
  59. #define    th_msg        th_data
  60.  
  61. /*
  62.  * Error codes.
  63.  */
  64. #define    EUNDEF        0        /* not defined */
  65. #define    ENOTFOUND    1        /* file not found */
  66. #define    EACCESS        2        /* access violation */
  67. #define    ENOSPACE    3        /* disk full or allocation exceeded */
  68. #define    EBADOP        4        /* illegal TFTP operation */
  69. #define    EBADID        5        /* unknown transfer ID */
  70. #define    EEXISTS        6        /* file already exists */
  71. #define    ENOUSER        7        /* no such user */
  72. @
  73.